Structs

A typed-erased RpcTransport, returning the commonly used dynamically-typed error anyhow::Error. Use this type instead of Box<RpcTransport<...>> to work around some sharp edges around actual trait objects.
A FnTransport wraps around a function that directly A FnService wraps around a function that directly implements [Service::call_raw].
A raw, JSON-RPC error. This should usually never be manually constructed.
A raw, JSON-RPC request. This should usually never be manually constructed.
A raw, JSON-RPC response. This should usually never be manually constructed.
An OrService responds to a call by trying one service then another.
A server-returned error message. Contains a string description as well as a structured value.

Enums

A raw, JSON-RPC request ID. This should usually never be manually constructed.

Traits

A struct implementing the RpcService represents the server-side logic of a NanoRPC. The method that needs to be implemented is RpcService::respond, but actual servers would typically call RpcService::respond_raw.
A client-side nanorpc transport. The only method that needs to be implemented is RpcTransport::call_raw, but clients typically call RpcTransport::call.

Attribute Macros

This procedural macro should be put on top of a async_trait trait with name ending in ...Protocol, defining all the function signatures in the RPC protocol. Given a trait of name FooProtocol, the macro